package com.mxchip.livestarmobile.mobile.rest

import androidx.lifecycle.LiveData
import retrofit2.http.*

interface PublicApi {

    @FormUrlEncoded
    @POST("login/verify_sms_code")
    fun loginVerifySmsCode(@Field("code") code: String, @Field("mobileNumber") mobileNumber: String): LiveData<ApiResponse<VerifySmsCodeResp>>

    @FormUrlEncoded
    @POST("login/send_sms_code")
    fun loginSendSmsCode(@Field("mobileNumber") mobileNumber: String): LiveData<ApiResponse<String>>

    @FormUrlEncoded
    @POST("login/{type}")
    fun loginSendCode(@Path("type") type: String, @FieldMap map: Map<String, String>): LiveData<ApiResponse<String>>

    @FormUrlEncoded
    @POST("login/{type}")
    fun loginVerifyCode(@Field("code") code: String, @FieldMap map: Map<String, String>, @Path("type") type: String): LiveData<ApiResponse<VerifySmsCodeResp>>

}

data class VerifySmsCodeResp(val token: String, val id: String)
